<template>
  <router-layout>
    <van-nav-bar slot="header" left-arrow :title="$route.meta.title" @click-left="$router.back()" @click-right="$router.push({ name: 'Home' })">
      <template #right v-if="$route.meta.home">
        <van-icon name="wap-home-o" size="22" />
      </template>
    </van-nav-bar>
    <keep-alive v-if="$route.meta.keep">
      <router-view></router-view>
    </keep-alive>
    <router-view v-else></router-view>
  </router-layout>
</template>
<script>
import { NavBar } from 'vant'
export default {
  components: {
    [NavBar.name]: NavBar
  }
}
</script>
